package com.csw.spring.service.impl;

import com.csw.spring.anno.Autowired;
import com.csw.spring.anno.Component;
import com.csw.spring.anno.Scope;
import com.csw.spring.framework.BeanNameAware;
import com.csw.spring.framework.InitializingBean;
import com.csw.spring.service.OrderService;
import com.csw.spring.service.UserService;

@Component("userServiceImpl")
@Scope("prototype")
public class UserServiceImpl implements UserService, BeanNameAware, InitializingBean {

    @Autowired
    private OrderServiceImpl orderServiceImpl;

    private String beanName;

    public String test() {
        System.out.println("beanName:" + beanName);
        return orderServiceImpl.getOrder();
    }

    public void setBeanName(String name) {
        this.beanName = name;
    }

    public void afterPropertiesSet() {
        System.out.println("这里主要是对已经注入了的属性进行认证，内容随便写，扩展接口");
    }
}
